package com.yoomiito.app.ui.my;

import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.yoomiito.app.Constant;
import com.yoomiito.app.R;
import com.yoomiito.app.base.App;
import com.yoomiito.app.model.bean.TabBean;
import com.yoomiito.app.present.my.activity.MyGiftExplosivePresenter;
import com.yoomiito.app.ui.fragment.my.MyOrderBaseFragment;
import com.yoomiito.app.ui.fragment.my.MyVipFragment;
import com.yoomiito.app.utils.AllUtils;
import com.yoomiito.app.utils.ResUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 礼包/爆品/优品
 */
public class MyVipOrderActivity extends MyOrderBaseActivity<MyGiftExplosivePresenter> {

    private int[] types = {Constant.VIP_TYPE_GIFT,Constant.VIP_TYPE_EXPLOSIVE,Constant.VIP_TYPE_YOUPIN, Constant.VIP_TYPE_SUBJECT};

    @Override
    public MyGiftExplosivePresenter newP() {
        return new MyGiftExplosivePresenter(App.mAppConfig);
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        titleView.setCenterText(ResUtil.getString(R.string.my_gift_or_explosive));
        desTv.setVisibility(View.VISIBLE);
        moneyTv.setTypeface(AllUtils.getTypeface());
        moneyTv.setText(getIntent().getStringExtra(Constant.KEY_ORDER_MONEY));
        desTv.setText(ResUtil.getString(R.string.my_order_account));
        desTitleTv.setText("待结算收益");
    }

    @Override
    protected List<MyOrderBaseFragment> getAllFragment() {
        List<MyOrderBaseFragment> list = new ArrayList<>();
        for (int type:types){
            MyVipFragment vipFragment = new MyVipFragment();
            Bundle youpinBundle = new Bundle();
            youpinBundle.putInt(MyVipFragment.KEY_TYPE,type);
            vipFragment.setArguments(youpinBundle);
            list.add(vipFragment);
        }
        return list;
    }

    @Override
    protected List<TabBean> getTabList() {
        List<TabBean> tabs = new ArrayList<>();
        tabs.add(new TabBean(ResUtil.getString(R.string.my_gift_bag),0,false));
        tabs.add(new TabBean(ResUtil.getString(R.string.my_explosive_goods),0,false));
        tabs.add(new TabBean("优品",0,false));
        tabs.add(new TabBean("课程",0,false));
        return tabs;
    }
}
